gtktreeviewaccessible: use a value_destroy_func with the cell_info_by_index hash
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 9 Nov 2011 13:32:32 +0000 (14:32 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 10 Nov 2011 13:49:30 +0000 (14:49 +0100)
This ensures that we don't leak any GtkTreeViewAccessibleCellInfo when
re-inserting a new one with the same key.

https://bugzilla.gnome.org/show_bug.cgi?id=663694

gtk/a11y/gtktreeviewaccessible.c

index 9a69326029f9eda866d61bbd5060755f9b734a9f..a3f8ce57bc2e693c0e9a1a05af47745d0198c541 100644 (file)
@@ -237,7 +237,8 @@ gtk_tree_view_accessible_initialize (AtkObject *obj,
   accessible->idle_expand_path = NULL;
   accessible->n_children_deleted = 0;
 
-  accessible->cell_info_by_index = g_hash_table_new (g_int_hash, g_int_equal);
+  accessible->cell_info_by_index = g_hash_table_new_full (g_int_hash,
+      g_int_equal, NULL, cell_info_free);
 
   widget = GTK_WIDGET (data);
   tree_view = GTK_TREE_VIEW (widget);
@@ -2845,7 +2846,6 @@ garbage_collect_cell_data (gpointer data)
     {
       if (!cell_info->in_use)
         {
-          cell_info_free (cell_info);
           g_hash_table_iter_remove (&iter);
         }
     }